관리 메뉴

꿀맛코딩

ERC20 코드 분석 1 본문

공부방/블록체인

ERC20 코드 분석 1

soycrab 2023. 4. 27. 11:12

 

https://docs.openzeppelin.com/contracts/4.x/api/token/erc20#ERC20FlashMint

 

ERC 20 - OpenZeppelin Docs

For an overview of ERC20 tokens and a walk through on how to create a token contract read our ERC20 guide. There are a few core contracts that implement the behavior specified in the EIP: IERC20: the interface all ERC20 implementations should conform to. I

docs.openzeppelin.com

 

transfer (토큰 전송)

recipient : 받는사람 

amount : 수량 

설명 : A가  B에게 10토큰  전송 

 

transferFrom (토큰 위임 전송)

sender: 보내는사람 

recipient: 받는사람 

설명 : A 가 B 에게 토큰을 전송하는데 실제 해당 함수를 실행 하는건 C (대리자) 임

 

allowance (대리자가 사용 가능한 토큰 개수 반환)

owner : 보내는 사람 (소유자)

spender : 대리자

 

approve  (대리자에게 위임 할 수량 지정)

spender : 대리자

amount : 수량

 

increaseAllowance (위임 토큰 수량 추가)

spender : 대리자

addedValue : 추가 수량

 

decreaseAllowance (위임 토큰 수량 감소)

spender : 대리자

subtractedValue : 감소 수량

 

 

출처 :  https://www.inflearn.com/course/lecture?courseSlug=%EC%86%94%EB%A6%AC%EB%94%94%ED%8B%B0-%EA%B9%A8%EB%B6%80%EC%88%98%EA%B8%B0-2&unitId=121476&tab=curriculum

반응형

'공부방 > 블록체인' 카테고리의 다른 글

솔리디티 문법  (0) 2023.04.24
ABI(Application Binary interface) 구현 방법  (0) 2023.04.21
Remix 가나슈 연결  (0) 2023.04.21
Web 3 js 를 이용한 지갑 잔액 확인  (0) 2023.04.21
Comments