일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- evm
- express.js
- Props
- Interface
- Redux
- useState
- REACT
- graphQL
- built in object
- JavaScript
- Ethereum
- API
- error
- CSS
- blockchain
- 삶
- 기준
- concept
- typeScript
- middleware
- bitcoin
- node.js
- HTML
- tailwindcss
- web
- nextJS
- SSR
- hardhat
- solidity
- CLASS
- Today
- Total
목록Blockchain/Solidity (46)
ReasonJun
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..