Etherscan에 코드 verify and publish하기

HyeongA·2023년 5월 26일
1

Blockchain_dev

목록 보기
20/20
post-thumbnail

concat

: 문자열 이어 붙이기
1) abi.encodePacked

function concat1(string memory a, string memory b) public pure returns(string memory){
        return string(abi.encodePacked(a,b));
    }

2) concat

    // a:aab:bb 와같이 string 여러개 연결 가능
    function concat3(string memory a, string memory b) public pure returns(string memory) {
        return string.concat(a,":", a, a, " ", b, ":", b, b); 
    }

Etherscan 코드 업로드

: 스마트 컨트랙트 배포 후 Etherscan에 코드 업로드 하는 방법

1. Etherscan에서 배포한 컨트랙트 조회 > contract > Verify and Publish
2. compiler Type, version, License Type설정 (version 꼭 확인하고 설정!)
3. 작성한 코드 기입 후 Verify and Publish 누르기

methodID

  • 계산하는 법
    : 함수명, 함수에 들어가는 인자 → keccak256 → bytes4
    : bytes4(keccak256(bytes(이름(변수형,변수형))))
profile
Solidity | React | Python

0개의 댓글