일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- ambiguous function description
- ethers
- erc4337 contract
- ethers v6
- 컨트렉트 배포 자동화
- 스마트컨트렉트 예약어 함수이름 중복
- 컨트렉트 동일한 함수이름 호출
- 러스트 기초
- 머신러닝기초
- SBT표준
- 스마트 컨트렉트 함수이름 중복
- git rebase
- ethers type
- ethers typescript
- 스마트컨트렉트 함수이름 중복 호출
- rust 기초
- 오블완
- 체인의정석
- 스마트컨트렉트테스트
- erc4337
- chainlink 설명
- 티스토리챌린지
- ethers websocket
- Vue.js
- multicall
- Vue
- 러스트 기초 학습
- 계정추상화
- vue기초
- 러스트기초
- Today
- Total
체인의정석
Solidity 0.5.0 버젼 오류해결 ) TypeError: Functions in interfaces must be declared external 본문
Solidity 0.5.0 버젼 오류해결 ) TypeError: Functions in interfaces must be declared external
체인의정석 2022. 1. 24. 16:54인터페이스의 경우 결국 외부에서 호출해와서 external call을 해야하는 것이기 때문에 public은 제외하고 external만 정의해야 한다.
https://github.com/ethereum/ethereum-org/issues/809
Functions in interfaces should be declared external. TokenERC20 Contract · Issue #809 · ethereum/ethereum-org
Hi, I am receiving the following error when using the TokenERC20: interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } ^---...
github.com
찾아보니 함수가 퍼블릭으로정의되어 있어도 external로 바꿔서 사용하라고 되어 있는데 확실한 방법을 보기 위하여 오픈 제플린을 찾아보도록 하겠다.
GitHub - OpenZeppelin/openzeppelin-contracts: OpenZeppelin Contracts is a library for secure smart contract development.
OpenZeppelin Contracts is a library for secure smart contract development. - GitHub - OpenZeppelin/openzeppelin-contracts: OpenZeppelin Contracts is a library for secure smart contract development.
github.com
GitHub - OpenZeppelin/openzeppelin-contracts: OpenZeppelin Contracts is a library for secure smart contract development.
OpenZeppelin Contracts is a library for secure smart contract development. - GitHub - OpenZeppelin/openzeppelin-contracts: OpenZeppelin Contracts is a library for secure smart contract development.
github.com
보면 정말 public을 인터페이스에서는 external로 정의한것을 볼 수 있었다. 이를 참고하여 코드를 수정하도록 하겠다.
최신버전도 한번 살펴보았는데
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol
GitHub - OpenZeppelin/openzeppelin-contracts: OpenZeppelin Contracts is a library for secure smart contract development.
OpenZeppelin Contracts is a library for secure smart contract development. - GitHub - OpenZeppelin/openzeppelin-contracts: OpenZeppelin Contracts is a library for secure smart contract development.
github.com
여기서도 함수는 모두 extenrnal로 정의되어 있었다.
앞으로 작성한 모든 인터페이스의 함수를 external로 설정해놔야 겠다.
어차피 인터페이스는 추상화 레벨에서 사용되는것이므로 이러한 방식을 취해야 하는것 같다.
물론 최신 버전에서는 virtural, override 개념이 있기 때문에 더 자세히 구분되는걸로 보아서 인터페이스에 대한 규격관련 사항들은 앞으로 더 엄격해지는 방향으로 업데이트가 되지 않을까 싶다.