pangyoelon

  • 홈
  • 태그
  • 방명록

solidity 2

여러개의 modifier 적용 시 순서

솔리디티의 modifier는 한 함수에 여러개 적용이 가능한데 그 순서를 알아보자 아래의 예시를 살펴보겠습니다 contract Test { address owner; modifier onlyOwner { require(msg.sender == owner); _; } modifier costs(uint price) { if (msg.value >= price) { _; } } constructor() public { owner = msg.sender; } function changeOwner(address newOwner) public onlyOwner costs(10) { owner = newOwner; } } 여기서 먼저 앞에 나온 onlyOwner부터 적용이 됩니다 고로 [ onlyOwner의 _; ..

Solidity 2023.06.15

솔리디티의 이상한 상속 계층구조

// SPDX-License-Identifier: MIT pragma solidity ^0.8.17; /* Inheritance tree A / \ B C \ / D */ contract A { function foo() public virtual { emit Log("A.foo called"); } function bar() public virtual { emit Log("A.bar called"); } } contract B is A { function foo() public virtual override { emit Log("B.foo called"); A.foo(); } function bar() public virtual override { emit Log("B.bar called"); supe..

Solidity 2023.04.26
이전
1
다음
더보기
프로필사진

pangyoelon

블록체인 개발자 https://github.com/km3140 https://velog.io/@pangyoelon

  • 분류 전체보기 (29)
    • BlockChain (4)
    • Node.js (6)
    • Javascript (1)
    • Solidity (4)
    • Git (3)
    • Go (1)
    • Shell (1)
    • 정보처리기사 (1)
    • React (2)
    • etc (2)
    • Typescript (1)
    • 해커톤 (1)
    • aws (1)

Tag

glitch hackathon, 깃허브 옵션, TypeError: Member "push" not found or not visible after argument-dependent lookup in, git, cors오류, solidity, 글리치 해커톤, 블록체인, react, undefined hackathon, 2022년 3월 5일 기출, ethersjs, axios baseURL, 채굴, lens protocol, Rebase, tx.wait, 비트코인, 구글링 연산자 이스케이프, undefined hacker house,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/08   »
일 월 화 수 목 금 토
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

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

  • Github

티스토리툴바