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

Upgrade to solidity 0.5.0 #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ShayanJa
Copy link

-Update contract syntax
-Fix up tests
-Update migrations

-Update contract syntax
-Fix up tests
-Update migrations

import "./DappToken.sol";

contract DappTokenSale {
address admin;
address payable admin;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add payable here, then in constructor for admin = msg.send I get this error:
"Type address is not implicitly convertible to expected type address payable."

require(tokenContract.transfer(admin, tokenContract.balanceOf(this)));

require(tokenContract.transfer(admin, tokenContract.balanceOf(address(this))));
// require(tokenContract.transfer(admin, tokenContract.balanceOf(address(this))));
// UPDATE: Let's not destroy the contract here
// Just transfer the balance to the admin
admin.transfer(address(this).balance);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think payable should be added here:
payable(admin).transfer(address(this).balance);

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