Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update week1_guug2.md #24

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions week1/week1_guug2.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
4. AAVE( app.avve.com )에서 지갑연결이 되지 않는다.(현재 서비스 점검 중인듯)
디파이가 기존 대출과 다른점은, 기존 대출 시에는 이자를 갚아야 하나, 디파이는 오히려 담보 예치금에 비례하여 이자를 제공해주기도 한다는 것이다.
또한 기존 대출과 달리, 심사 과정이 따로 없는 등 외부 개입요소가 없다는 것이다.
// 수정
28 changes: 28 additions & 0 deletions week3/myNFT.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.14;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";

contract myNFT is ERC721 {
Counters.Counter private _tokenIdCounter;
mapping(address => uint256) mintCount;
constructor () public {
owner = msg.sender ;

}
function itemMint(string memory uri){
// 최대 1번 민팅 제한, 민팅시 잔고부족하면 거절
require(mintCount(msg.sender) < 1 );
require(balances[msg.sender] > 0.001 );

// 1번 민팅할때마다 TokenId 1씩 증가
_tokenIdCounter.increment();
uint256 tokenId = _tokenIdCounter.current();
// 민팅기능
_mint(msg.sender, tokenId);
_setTokenURI(tokenId, uri);
// 민팅 시, 잔고 0.001 차감
balances[msg.sender] -= 0.001;
}
}