일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
- Interface
- hardhat
- node.js
- typeScript
- CSS
- 삶
- Props
- tailwindcss
- JavaScript
- web
- nextJS
- CLASS
- evm
- REACT
- express.js
- bitcoin
- built in object
- solidity
- graphQL
- concept
- error
- SSR
- useState
- middleware
- Redux
- 기준
- API
- blockchain
- HTML
- Ethereum
- Today
- Total
목록전체 글 (375)
ReasonJun
// SPDX-License-Identifier: MIT pragma solidity >= 0.7.0 < 0.9.0; contract Array { uint[] public arr; uint[] public arr2 = [1, 2, 3]; uint[10] public myFixedSizeArr; // 0 function get(uint i) public view returns (uint) { return arr[i]; } function get() public view returns (uint[] memory) { return arr; } function push(uint i) public { arr.push(i); } function pop() public { arr.pop(); } function g..
Memory and calldata are two different data locations in Solidity. Memory is used to store temporary data during the execution of a function, while calldata is used to store function arguments. Memory Memory is a temporary data location that is used to store data during the execution of a function. When a function is called, memory is allocated for the function call and all local variables in the..
A mapping in Solidity is a data structure that stores key-value pairs. The key can be of any built-in data type, except reference types, and the value can be of any type, including mappings, arrays, and structs. Mappings are similar to dictionaries in other programming languages. They are often used to store data that needs to be accessed quickly and easily, such as user accounts, balances, and ..
Keccak256 is a cryptographic hash function that takes an input of any length and produces a fixed-length output of 256 bits. It is a one-way function, which means that it is easy to compute the hash of an input but very difficult to reverse the hash and find the original input. Keccak256 is used in a variety of cryptographic applications, including digital signatures, message authentication code..
Events and emit are two important concepts in Solidity. Events are a way to log and notify external entities (such as user interfaces or other smart contracts) about specific occurrences within a smart contract. Emit is the keyword used to trigger or emit events within the smart contract code. Events are similar to logs or records that capture important information, allowing external observers t..
// SPDX-License-Identifier: MIT pragma solidity >= 0.7.0 < 0.9.0; contract Ex1 { uint public a = 3; uint public b = 5; function myBlock() public returns (uint, uint){ a = 99; b = 0; return(a, b); } function myBlcok2(uint c) public { a = c; } function myBlock3() public pure returns(uint age, uint weight) { age = 20; weight = 55; } function getValue(uint e) public pure returns (uint) { return e; }..
Pure and view functions are special types of functions in Solidity that have different restrictions on how they can interact with the state of the contract. Pure functions do not read or modify the state of the contract. They can only use the parameters that are passed to them and local variables. Pure functions are often used to perform calculations or to validate data. View functions can read ..
Visibility in Solidity is used to control who can access and modify functions and state variables within a contract. There are four visibility levels in Solidity: Public: Public functions and state variables can be accessed by anyone, inside or outside of the contract. Internal: Internal functions and state variables can be accessed by any function within the contract, as well as any function wi..
Operators in Solidity are used to perform various operations on data. There are many different types of operators, each with its own specific function. The most common types of operators in Solidity are: Arithmetic operators: These operators are used to perform basic arithmetic operations, such as addition, subtraction, multiplication, and division. Comparison operators: These operators are used..
A constant in Solidity is a variable whose value cannot be changed once it has been initialized. Constants are defined using the constant keyword. Constants can be used to represent values that should not change, such as the maximum supply of a token or the address of a trusted contract. They can also be used to improve the readability and maintainability of your code. Here is an example of how ..