일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 31 |
- evm
- JavaScript
- useState
- node.js
- concept
- nextJS
- Props
- API
- HTML
- Interface
- middleware
- 기준
- CSS
- Redux
- built in object
- Ethereum
- tailwindcss
- graphQL
- bitcoin
- REACT
- solidity
- blockchain
- error
- SSR
- web
- CLASS
- hardhat
- express.js
- 삶
- typeScript
- Today
- Total
목록전체 글 (373)
ReasonJun
An abstract contract in Solidity is a contract that cannot be deployed by itself. It must be inherited by other contracts. Abstract contracts are used to define the common functionality of a group of related contracts. To create an abstract contract, you use the abstract keyword. For example, the following contract is abstract: abstract contract Student { function major() public pure virtual ret..
The virtual and override keywords in Solidity are used to support function overriding. Function overriding allows you to redefine a function that is inherited from a base contract. This can be useful for customizing the behavior of the function for your specific needs. Virtual functions A function is marked as virtual if it can be overridden by derived contracts. When a function is marked as vir..
Function overloading in Solidity allows you to define multiple functions with the same name but different argument types and/or numbers. This can be useful for creating more flexible and reusable code. For example, the following contract defines an overloaded add() function: contract Math { function add(uint256 a, uint256 b) public pure returns (uint256) { return a + b; } function add(uint256 a,..
// SPDX-License-Identifier: MIT pragma solidity >= 0.7.0 < 0.9.0; contract Number { uint private num = 4; function changeNum() public { num = 5; } function getNum() public view returns (uint) { return num; } } contract Caller { Number internal instance = new Number(); function changeNumber() public { instance.changeNum(); } function getNumber() public view returns(uint) { return instance.getNum(..
Inheritance in Solidity is a way to create new contracts that reuse and extend the functionality of existing contracts. This can be useful for reducing code duplication, creating reusable libraries, and building complex systems from smaller components. is To inherit from another contract, you use the is keyword. For example, the following contract inherits from the ERC20 contract: contract MyTok..
Immutable and constant are two keywords that can be used to declare variables in Solidity. Both keywords can be used to prevent the value of a variable from being changed, but they have some key differences. Constant variables are initialized at compile time and their value cannot be changed afterwards. This means that constant variables can only be assigned a value once, and they cannot be reas..
A constructor in Solidity is a special function that is called when a smart contract is deployed. It is used to initialize the state of the contract, such as setting the initial values of state variables. Constructors are optional, but they are recommended for all smart contracts. This is because constructors provide a way to ensure that the contract is initialized in a valid state before it can..
An event in Solidity is a way to log and notify external entities (such as user interfaces or other smart contracts) about specific occurrences within a smart contract. Events are similar to logs or records that capture important information, allowing external observers to react to them and obtain relevant data. Events are defined using the event keyword, followed by the name of the event and th..
// 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..