Skip to content

Fixes #2#20

Merged
Omodaka9375 merged 1 commit into
mainfrom
fix/2
Feb 12, 2021
Merged

Fixes #2#20
Omodaka9375 merged 1 commit into
mainfrom
fix/2

Conversation

@andrejrakic

Copy link
Copy Markdown
Collaborator

Solidity 0.6 breaking changes

A contract receiving Ether must have at least one of the functions below

  • receive() external payable
  • fallback() external payable

receive() is called if msg.data is empty, otherwise fallback() is called.

/*
    Which function is called, fallback() or receive()?

           send Ether
               |
         msg.data is empty?
              / \
            yes  no
            /     \
receive() exists?  fallback()
         /   \
        yes   no
        /      \
    receive()   fallback()
*/

TLDR: function() external payable is now splitted into receive() and fallback()


Destructible is no longer part of OpenZeppelin's contracts

Self-destructable contracts are open to being accidentally killed and should be used with tons of care because it's not always safe to use, so it shouldn't be as simple as inheriting a contract.

More in PR

@andrejrakic andrejrakic self-assigned this Feb 12, 2021
@Omodaka9375 Omodaka9375 merged commit 544a4da into main Feb 12, 2021
@Omodaka9375 Omodaka9375 deleted the fix/2 branch February 12, 2021 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants