Skip to content

Instantly share code, notes, and snippets.

View Violet-Bora-Lee's full-sized avatar
πŸ’œ
I code, build and act.

Bora Lee Violet-Bora-Lee

πŸ’œ
I code, build and act.
View GitHub Profile
@Violet-Bora-Lee
Violet-Bora-Lee / react-performance.txt
Created April 26, 2025 04:23
ꢁ극의 μ„±λŠ₯을 λ½‘μ•„λ‚΄λŠ” λ¦¬μ•‘νŠΈ ν”„λ‘¬ν”„νŠΈ
```
You are an expert React code optimizer. Your goal is to analyze provided React code snippets (or descriptions of code structure) and identify potential performance bottlenecks related to unnecessary rerendering. Your analysis should specifically check for the following, providing specific code examples and explanations where applicable:
<Unnecessary Rerenders>
1. **Component-Level Rerendering:** Analyze the provided code (or description) and determine if components are rerendering unnecessarily. Explain why the rerendering is happening, citing specific lines of code if available. Consider the following:
@Violet-Bora-Lee
Violet-Bora-Lee / DebugContracts.tsx
Created October 7, 2024 18:35
Speed Run Ethereum, #2: Token Vendor, Debug Contracts page
"use client";
import { useCallback, useEffect, useMemo, useState } from "react";
import { BarsArrowUpIcon } from "@heroicons/react/20/solid";
import { ContractUI } from "~~/app/debug/_components/contract";
import { ContractName } from "~~/utils/scaffold-eth/contract";
import { getAllContracts } from "~~/utils/scaffold-eth/contractsData";
const selectedContractStorageKey = "scaffoldEth2.selectedContract";
const contractsData = getAllContracts();

이더리움 기초

![[Pasted image 20240323012814.png]]

μ†”λ¦¬λ””ν‹°μ—μ„œ 데이터λ₯Ό μ €μž₯ν•  수 μžˆλŠ” 곡간은 총 6κ°œμ΄λ‹€. μ†”λ¦¬λ””ν‹°λ‘œ μ½”λ”©ν•˜λ©΄μ„œ 자주 μ–ΈκΈ‰λ˜λŠ” κ°œλ…μ€ 총 stack, memory, storage, calldata μ΄λ―€λ‘œ 이 넷에 λŒ€ν•΄ μ•Œμ•„λ³΄μž.

Stack

EVM은 κΈ°μ‘΄ ν”„λ‘œμ„Έμ„œμ™€ μ»΄ν“¨ν„°μ—μ„œ λ³Ό 수 μžˆλŠ” λ ˆμ§€μŠ€ν„° 기반 μ•„ν‚€ν…μ²˜κ°€ μ•„λ‹Œ μŠ€νƒ 기반 μ•„ν‚€ν…μ²˜μ΄λ‹€.

EVM의 μŠ€νƒμ—” 16μ§„μˆ˜ 32λ°”μ΄νŠΈ μ›Œλ“œ(word)λ₯Ό λ‹¨μœ„λ‘œ μžλ£Œκ°€ μ €μž₯λœλ‹€.

c#을 μ‚¬μš©ν•œ λ¦¬νŒ©ν† λ§ 기법

기법1

기법2

@Violet-Bora-Lee
Violet-Bora-Lee / erc20.sol
Created March 30, 2024 18:30
erc-20 토큰 λ°œν–‰
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract MyToken is ERC20 {
constructor() ERC20("DUG Coin", "DUG") {
_mint(msg.sender, 100 * 10 ** ERC20.decimals());
}
@Violet-Bora-Lee
Violet-Bora-Lee / curl.bash
Created March 26, 2024 12:09
bitfinity test token add
curl https://testnet.bitfinity.network \
-X POST -H 'content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":"67","method":"ic_mintNativeToken","params":["0x629A54Cb82f9A300a67bB77477D747a1F19815Cf", "0x100"]}'
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
contract MoodDiary {
string mood;
function setMood(string memory _mood) public {
mood = _mood;
}
@Violet-Bora-Lee
Violet-Bora-Lee / wl_mapping.sol
Created October 4, 2023 02:21
솔리디티 λ§€ν•‘ μ—°μŠ΅
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
contract Whitelist {
// ν™”μ΄νŠΈ λ¦¬μŠ€νŠΈμ— λ“±λ‘λœ μ‚¬λžŒμ„ κ΄€λ¦¬ν•˜λŠ” μš©λ„μ˜ mapμž‘μ„±
// mapping λ³€μˆ˜ μ„ μ–Έ
// ν™”μ΄νŠΈ λ¦¬μŠ€νŠΈμ— νŠΉμ • μ£Όμ†Œλ₯Ό λ“±λ‘μ‹œν‚€λŠ” ν•¨μˆ˜ μ„ μ–Έ
}
@Violet-Bora-Lee
Violet-Bora-Lee / event_example.sol
Created October 3, 2023 14:10
솔리디티 이벀트 μ˜ˆμ‹œ
pragma solidity ^0.8.0;
contract SimpleToken {
mapping(address => uint256) public balances;
// 토큰 전솑 이벀트 μ •μ˜
event Transfer(address indexed _from, address indexed _to, uint256 _amount);
constructor(uint256 initialSupply) {
balances[msg.sender] = initialSupply;
@Violet-Bora-Lee
Violet-Bora-Lee / state_variable_example.sol
Last active October 3, 2023 14:06
솔리디티 μƒνƒœλ³€μˆ˜ μ˜ˆμ‹œ
pragma solidity ^0.8.0;
contract SimpleToken {
// state λ³€μˆ˜λ‘œ 각 μ£Όμ†Œμ˜ μž”μ•‘μ„ μ €μž₯
mapping(address => uint256) public balances;
// 초기 μž”μ•‘ μ„€μ •
constructor(uint256 initialSupply) {
balances[msg.sender] = initialSupply;
}