Skip to content

Commit f8588f7

Browse files
committed
init: voting + Token lottery
1 parent bfb153b commit f8588f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+3147
-1
lines changed

.gitignore

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
Cargo.lock
2+
yarn.lock
3+
package-lock.json
4+
target/
5+
.DS_Store
6+
7+
# Logs
8+
logs
9+
*.log
10+
npm-debug.log*
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
17+
# Directory for instrumented libs generated by jscoverage/JSCover
18+
lib-cov
19+
20+
# Coverage directory used by tools like istanbul
21+
coverage
22+
23+
# nyc test coverage
24+
.nyc_output
25+
26+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
27+
.grunt
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (http://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules
37+
jspm_packages
38+
39+
# Optional npm cache directory
40+
.npm
41+
42+
# Optional REPL history
43+
.node_repl_history
44+
.next/
45+
.anchor/

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,37 @@
1-
# developer-bootcamp-2024
1+
<div align="center">
2+
<h1> Blockchain Developer & Smart Contract Bootcamp</h1>
3+
<h3> Beginner to Expert Course </h3>
4+
5+
<p align="center"><strong>Learn smart contract development and level up your career</strong></p>
6+
</div>
7+
8+
9+
Welcome to the repository for the full Blockchain Developer Bootcamp. This repository contains the full course material, code examples, and other resources for the course.
10+
11+
This bootcamp is for anyone interested in learning how to build on a blockchain. You do not require any knowledge of blockchains, smart contracts, or Rust to get started. We will cover everything you need to know to get starting building on the Solana blockchain today.
12+
13+
### What You Will Learn
14+
15+
- What are blockchains and when you should use them
16+
- How to build full scale applications on the Solana blockchain
17+
- Some basic Rust, cryptography, and blockchain concepts
18+
19+
The goal of this bootcamp is to take any developer that is crypto-curious and teach them how to build on the Solana blockchain. We will cover everything from the basics of blockchain to building full scale applications on the Solana blockchain.
20+
21+
### Preqrequisites
22+
23+
- Mac, Windows, or Linux Laptop
24+
- Basic understanding of Software Development
25+
26+
### Resources
27+
28+
If you're stuck, you can always refer to the following resources:
29+
30+
- The absolute best place for questions: [Solana StackExchange](https://solana.stackexchange.com/)
31+
- [Solana Documentation](https://solana.com/docs)
32+
- [Anchor Documentation](https://www.anchor-lang.com/)
33+
- [Rust Documentation](https://doc.rust-lang.org/book/)
34+
35+
## Table of Contents
36+
37+
TBD

project-2-voting/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 jacobcreech
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"extends": ["../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7+
"rules": {}
8+
},
9+
{
10+
"files": ["*.ts", "*.tsx"],
11+
"rules": {}
12+
},
13+
{
14+
"files": ["*.js", "*.jsx"],
15+
"rules": {}
16+
},
17+
{
18+
"files": ["*.json"],
19+
"parser": "jsonc-eslint-parser",
20+
"rules": {
21+
"@nx/dependency-checks": [
22+
"error",
23+
{
24+
"ignoredFiles": ["{projectRoot}/rollup.config.{js,ts,mjs,mts}"]
25+
}
26+
]
27+
}
28+
}
29+
]
30+
}

project-2-voting/anchor/.swcrc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"jsc": {
3+
"target": "es2017",
4+
"parser": {
5+
"syntax": "typescript",
6+
"decorators": true,
7+
"dynamicImport": true
8+
},
9+
"transform": {
10+
"decoratorMetadata": true,
11+
"legacyDecorator": true
12+
},
13+
"keepClassNames": true,
14+
"externalHelpers": true,
15+
"loose": true
16+
},
17+
"module": {
18+
"type": "es6"
19+
},
20+
"sourceMaps": true,
21+
"exclude": [
22+
"jest.config.ts",
23+
".*\\.spec.tsx?$",
24+
".*\\.test.tsx?$",
25+
"./src/jest-setup.ts$",
26+
"./**/jest-setup.ts$",
27+
".*.js$"
28+
]
29+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[toolchain]
2+
3+
[features]
4+
seeds = false
5+
skip-lint = false
6+
7+
[programs.localnet]
8+
voting = "5s3PtT8kLYCv1WEp6dSh3T7EuF35Z6jSu5Cvx4hWG79H"
9+
10+
[registry]
11+
url = "https://api.apr.dev"
12+
13+
[provider]
14+
cluster = "Localnet"
15+
wallet = "~/.config/solana/id.json"
16+
17+
[scripts]
18+
test = "../node_modules/.bin/nx run anchor:jest"
19+
20+
[test]
21+
startup_wait = 5000
22+
shutdown_wait = 2000
23+
upgradeable = false
24+
25+
[test.validator]
26+
bind_address = "127.0.0.1"
27+
ledger = ".anchor/test-ledger"
28+
rpc_port = 8899

project-2-voting/anchor/Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[workspace]
2+
members = [
3+
"programs/*"
4+
]
5+
resolver = "2"
6+
7+
[profile.release]
8+
overflow-checks = true
9+
lto = "fat"
10+
codegen-units = 1
11+
[profile.release.build-override]
12+
opt-level = 3
13+
incremental = false
14+
codegen-units = 1

project-2-voting/anchor/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# anchor
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
## Building
6+
7+
Run `nx build anchor` to build the library.
8+
9+
## Running unit tests
10+
11+
Run `nx test anchor` to execute the unit tests via [Jest](https://jestjs.io).
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/* eslint-disable */
2+
import { readFileSync } from 'fs';
3+
4+
// Reading the SWC compilation config and remove the "exclude"
5+
// for the test files to be compiled by SWC
6+
const { exclude: _, ...swcJestConfig } = JSON.parse(
7+
readFileSync(`${__dirname}/.swcrc`, 'utf-8')
8+
);
9+
10+
// disable .swcrc look-up by SWC core because we're passing in swcJestConfig ourselves.
11+
// If we do not disable this, SWC Core will read .swcrc and won't transform our test files due to "exclude"
12+
if (swcJestConfig.swcrc === undefined) {
13+
swcJestConfig.swcrc = false;
14+
}
15+
16+
// Uncomment if using global setup/teardown files being transformed via swc
17+
// https://nx.dev/packages/jest/documents/overview#global-setup/teardown-with-nx-libraries
18+
// jest needs EsModule Interop to find the default exported setup/teardown functions
19+
// swcJestConfig.module.noInterop = false;
20+
21+
export default {
22+
displayName: 'anchor',
23+
preset: '../jest.preset.js',
24+
transform: {
25+
'^.+\\.[tj]s$': ['@swc/jest', swcJestConfig],
26+
},
27+
moduleFileExtensions: ['ts', 'js', 'html'],
28+
testEnvironment: '',
29+
coverageDirectory: '../coverage/anchor',
30+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Migrations are an early feature. Currently, they're nothing more than this
2+
// single deploy script that's invoked from the CLI, injecting a provider
3+
// configured from the workspace's Anchor.toml.
4+
5+
import * as anchor from '@coral-xyz/anchor';
6+
7+
module.exports = async function (provider) {
8+
// Configure client to use the provider.
9+
anchor.setProvider(provider);
10+
11+
// Add your deploy script here.
12+
};

0 commit comments

Comments
 (0)