[개발]Solidity Verify Contract 과정 정리

in mini.topia3 years ago

어제에 이어 간단하지만 Verify Contract 하는 과정을 작성해 봅니다.(Flat화 된 Solidity를 Verify 해봅니다.)

메모메모!!


아직 소스가 Verify가 되지 않은 경우 Contract 탭을 눌러보면 아래와 같이 표시가 됩니다.(샘플 : https://testnet.bscscan.com/address/0x0f3d77e316cee75511765a4a8c9934c87c6a7c6a#code)

그럴 경우 중간에 보이는 파란색 "Verify and Publish"를 누르셔도 되고 https://testnet.bscscan.com/verifyContract 이 링크에서 Contract Address 값을 직접 입력해주셔도 됩니다.

Contract 및 Compiler 정보 입력

  • Please enter the Contract Address you would like to verify : contract 주소 입력
  • Please select Compiler Type : Solidity(Single File) // 이미 flat화 작업을 하였기 때문에 Single로 선택
  • Please select Compiler Version : 컴파일 버전에 따라 인코딩 된 값이 다르게 표시 될 수도 있으므로 실제로 컴파일 된 버전을 선택
  • Please select Open Source License Type : License Type를 입력 해줍니다. 보통 Smart Contract는 누구나 수정할 수 있는 MIT 라이센스를 많이 사용합니다.

Verify를 위한 소스 입력

  • 아래 Enter the Solidity Contract Code below 부분에 실제로 작성한 Solidity 코드를 모두 복사하여 붙여넣기를 합니다.
  • 그 아래에 Constructor Arguments... 부분은 constructor 부분에 parameters가 있었던 경우 자동으로 입력되어 있으므로 참고바랍니다.(constructor 부분에 변수가 없는 경우 공백으로 처리)
  • 그리고 가장 하단에 Verify and Publish를 클릭!!

제대로 Verify가 완료된 경우

  • 제대로 성공한 경우 아래와 같이 초록색으로 표시가 되지만,

  • 실패한 경우 아래와 같이 붉은색 Error가 표시됩니다.

  • 이런 경우 붙여넣은 소스가 잘못 된 부분이 없는지 확인 과정이 필요합니다.

Sort:  

Congratulations @happyberrysboy! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :

You have been a buzzy bee and published a post every day of the week

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP