티스토리 뷰
728x90
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.11;
interface PocketWrapper {
struct Item {
string name;
uint256 price;
}
function addItem(string memory _name, uint256 _price) external;
function getItem(uint256 _index) external view returns (Item memory _item);
}
contract Pocket is PocketWrapper {
Item[] public items;
function addItem(string memory _name, uint256 _price) public override {
items.push(Item(_name, _price));
}
function getItem(uint256 _index) public view returns (Item memory) {
return items[_index];
}
}'블록체인 개발 > Solidity' 카테고리의 다른 글
| Upgradable Contracts 1 (Proxy Pattern) (0) | 2022.04.03 |
|---|---|
| mapping 타입에서 겪었던 에러 (0) | 2022.01.02 |
| call (0) | 2022.01.02 |
| fallback, receive (0) | 2022.01.02 |
| send, transfer, call (0) | 2022.01.02 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- ethers.js
- Flutter
- 블록체인
- ganache
- caver.js
- web3-token
- Proxy Pattern
- 블록 탐색기
- Call
- interface
- avalanchego
- erc20
- Truffle
- typescript
- Hardhat
- web3.js
- web3
- JWT
- class
- swr
- eslint
- 스마트 컨트랙트
- caver-js
- nft
- 이더리움
- ERC721
- Upgradeable Contracts
- metamask-extension
- Android
- 앱 아이콘
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함