Skip to content

Instantly share code, notes, and snippets.

View SuhwanCha's full-sized avatar
✝️

Suhwan Cha SuhwanCha

✝️
  • Seoul, South Korea
  • 04:50 (UTC +09:00)
View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol";
import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
contract Voting is EIP712 {
struct Poll {
uint8 optionCount;
bool tallied;
{
"list": {
"0": {
"name": "김하늘",
"studentId": "24"
},
"1": {
"name": "박민수",
"studentId": "24"
},

step

pending11('11-pending', '회장선거'),
pending12('12-pending', '회장 결정전', forceNext: true),
present1('present-1', '회장 발표', forceNext: true),
pending21('21-pending', '부회장선거', forceNext: true),
pending22('22-pending', '부회장 결정전', forceNext: true),
present2('present-2', '비회장 발표', forceNext: true),
@SuhwanCha
SuhwanCha / index.ts
Created October 12, 2024 13:13
투표 코드
import * as logger from "firebase-functions/logger";
import * as admin from "firebase-admin";
import * as functions from "firebase-functions";
// Initialize Firebase Admin SDK
admin.initializeApp();
exports.createSession2 = functions
.region("asia-northeast3").https.onCall((request) => {
@SuhwanCha
SuhwanCha / sample.json
Created September 28, 2024 12:12
총회 데이터 샘플
{
"list": [
{
"class_id": 19, <-- 학번
"name": "홍길동" <-- 이름
},
{
"class_id": 19,
"name": "홍길동2"
},
@SuhwanCha
SuhwanCha / vote.dart
Last active October 7, 2023 14:51
대학부 1차 투표 알고리즘
static const _kSecretKey = '*********';
...
// Creates visitor ID from IP addr., OS Version and so on.
// When visitor data has been generated, it will be hashed with Jenkins Hash Functions
/// Combine hash codes of multiple objects
///
/// Jenkins Hash Functions