Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface functions are external, or no interfaces #2330

Closed
chriseth opened this issue May 30, 2017 · 11 comments
Closed

Interface functions are external, or no interfaces #2330

chriseth opened this issue May 30, 2017 · 11 comments

Comments

@chriseth
Copy link
Contributor

Suggestion by @pirapira :

Functions in interface contracts are external by default and functions cannot be anything else than external.

We have to make sure that it is still fine to override external interface functions with public functions in contracts.

@pirapira
Copy link
Member

I would argue interfaces are not contracts, and their members have no visibilities.

When a contract inherits an interface, the contract's externally visible members are examined against the interface's members.

@pirapira
Copy link
Member

Another good way (which I prefer) is to remove the interface keyword so that we do not need to choose a meaning of the word.

@pirapira pirapira changed the title Interface functions are external Interface functions are external, or no interfaces May 30, 2017
@axic
Copy link
Member

axic commented May 30, 2017

I think it is a good idea to change the "visibility" to external and disallow visibility modifiers in interfaces. They are meant to describe what the ABI describes.

I am not in favour of removing the interface keyword.

@axic
Copy link
Member

axic commented Jul 20, 2017

I would argue interfaces are not contracts

Would it make sense introducing a new keyword implements / supports for interfaces to dinstinguish between inheritance?

contract Nekot supports Token {}

@chriseth
Copy link
Contributor Author

If we do that, I would vote for implements, although I'm not sure if this justifies another keyword to learn.

@axic
Copy link
Member

axic commented Oct 3, 2017

Question is, should we force the external keyword be present or force that no keyword is present?

@fulldecent
Copy link
Contributor

@pirapira further arguments on getting rid of the current interface keyword are at #3420.

@axic
Copy link
Member

axic commented Jan 31, 2018

Question is, should we force the external keyword be present or force that no keyword is present?

Actually #3038 has implemented this for 0.5.0.

Just shows we need to create that 0.5.0 release sooner rather than later..

@fulldecent
Copy link
Contributor

fulldecent commented Feb 5, 2018

@chriseth I think we can mark this as closed because of #3038


The second half of your original issue is duplicated here (and has a test case)

#3458

@axic
Copy link
Member

axic commented Feb 27, 2018

Started implementing this.

@axic axic self-assigned this Feb 28, 2018
@axic
Copy link
Member

axic commented Mar 1, 2018

Realised that actually this was implemented already via #3038.

@axic axic closed this as completed Mar 1, 2018
kophyo1234 added a commit to kophyo1234/openzeppelin-contracts that referenced this issue Jan 29, 2022
Standards

ERC-20 Token Standard.
ERC-165 Standard Interface Detection.
ERC-173 Owned Standard.
ERC-223 Token Standard.
ERC-677 transferAndCall Token Standard.
ERC-827 Token Standard.
Ethereum Name Service (ENS). https://ens.domains
Instagram – What’s the Image Resolution? https://help.instagram.com/1631821640426723
JSON Schema. https://json-schema.org/
Multiaddr. https:/multiformats/multiaddr
RFC 2119 Key words for use in RFCs to Indicate Requirement Levels. https://www.ietf.org/rfc/rfc2119.txt
Issues

The Original ERC-721 Issue. ethereum/EIPs#721
Solidity Issue OpenZeppelin#2330 – Interface Functions are External. ethereum/solidity#2330
Solidity Issue OpenZeppelin#3412 – Implement Interface: Allow Stricter Mutability. ethereum/solidity#3412
Solidity Issue OpenZeppelin#3419 – Interfaces Can’t Inherit. ethereum/solidity#3419
Solidity Issue OpenZeppelin#3494 – Compiler Incorrectly Reasons About the selector Function. ethereum/solidity#3494
Solidity Issue OpenZeppelin#3544 – Cannot Calculate Selector of Function Named transfer. ethereum/solidity#3544
CryptoKitties Bounty Issue OpenZeppelin#4 – Listing all Kitties Owned by a User is O(n^2). dapperlabs/cryptokitties-bounty#4
OpenZeppelin Issue OpenZeppelin#438 – Implementation of approve method violates ERC20 standard. OpenZeppelin#438
Solidity DelegateCallReturnValue Bug. https://solidity.readthedocs.io/en/develop/bugs.html#DelegateCallReturnValue
Discussions

Reddit (announcement of first live discussion). https://www.reddit.com/r/ethereum/comments/7r2ena/friday_119_live_discussion_on_erc_nonfungible/
Gitter #EIPs (announcement of first live discussion). https://gitter.im/ethereum/EIPs?at=5a5f823fb48e8c3566f0a5e7
ERC-721 (announcement of first live discussion). ethereum/EIPs#721 (comment)
ETHDenver 2018. https://ethdenver.com
NFT Implementations and Other Projects

CryptoKitties. https://www.cryptokitties.co
0xcert ERC-721 Token. https:/0xcert/ethereum-erc721
Su Squares. https://tenthousandsu.com
Decentraland. https://decentraland.org
CryptoPunks. https://www.larvalabs.com/cryptopunks
DMarket. https://www.dmarket.io
Enjin Coin. https://enjincoin.io
Ubitquity. https://www.ubitquity.io
Propy. https://tokensale.propy.com
CryptoKitties Deployed Contract. https://etherscan.io/address/0x06012c8cf97bead5deae237070f9587f8e7a266d#code
Su Squares Bug Bounty Program. https:/fulldecent/su-squares-bounty
XXXXERC721. https:/fulldecent/erc721-example
ERC721ExampleDeed. https:/nastassiasachs/ERC721ExampleDeed
Curio Cards. https://mycuriocards.com
Rare Pepe. https://rarepepewallet.com
Auctionhouse Asset Interface. https:/dob/auctionhouse/blob/master/contracts/Asset.sol
OpenZeppelin SafeERC20.sol Implementation. https:/OpenZeppelin/zeppelin-solidity/blob/master/contracts/token/ERC20/SafeERC20.sol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants