티스토리 뷰
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
- Truffle
- ethers.js
- web3
- 스마트 컨트랙트
- Hardhat
- ERC721
- avalanchego
- Android
- erc20
- Upgradeable Contracts
- 이더리움
- caver.js
- eslint
- ganache
- web3-token
- 블록 탐색기
- nft
- class
- 앱 아이콘
- typescript
- Flutter
- Call
- web3.js
- Proxy Pattern
- 블록체인
- swr
- interface
- JWT
- metamask-extension
- caver-js
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함