mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update test suite to use address payable.
This commit is contained in:
@@ -32,7 +32,7 @@ contract MultisigWallet is Multisig, Shareable, DayLimit {
|
||||
/**
|
||||
* @dev destroys the contract sending everything to `_to`.
|
||||
*/
|
||||
function destroy(address _to) onlymanyowners(keccak256(msg.data)) external {
|
||||
function destroy(address payable _to) onlymanyowners(keccak256(msg.data)) external {
|
||||
selfdestruct(_to);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ contract Crowdsale {
|
||||
uint256 public endBlock;
|
||||
|
||||
// address where funds are collected
|
||||
address public wallet;
|
||||
address payable public wallet;
|
||||
|
||||
// how many token units a buyer gets per wei
|
||||
uint256 public rate;
|
||||
@@ -40,7 +40,7 @@ contract Crowdsale {
|
||||
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
|
||||
|
||||
|
||||
constructor(uint256 _startBlock, uint256 _endBlock, uint256 _rate, address _wallet) public {
|
||||
constructor(uint256 _startBlock, uint256 _endBlock, uint256 _rate, address payable _wallet) public {
|
||||
require(_startBlock >= block.number);
|
||||
require(_endBlock >= _startBlock);
|
||||
require(_rate > 0);
|
||||
|
||||
@@ -15,20 +15,20 @@ contract RefundVault is Ownable {
|
||||
enum State { Active, Refunding, Closed }
|
||||
|
||||
mapping (address => uint256) public deposited;
|
||||
address public wallet;
|
||||
address payable public wallet;
|
||||
State public state;
|
||||
|
||||
event Closed();
|
||||
event RefundsEnabled();
|
||||
event Refunded(address indexed beneficiary, uint256 weiAmount);
|
||||
|
||||
constructor(address _wallet) public {
|
||||
constructor(address payable _wallet) public {
|
||||
require(_wallet != address(0x0));
|
||||
wallet = _wallet;
|
||||
state = State.Active;
|
||||
}
|
||||
|
||||
function deposit(address investor) public onlyOwner payable {
|
||||
function deposit(address payable investor) public onlyOwner payable {
|
||||
require(state == State.Active);
|
||||
deposited[investor] = deposited[investor].add(msg.value);
|
||||
}
|
||||
@@ -46,7 +46,7 @@ contract RefundVault is Ownable {
|
||||
emit RefundsEnabled();
|
||||
}
|
||||
|
||||
function refund(address investor) public {
|
||||
function refund(address payable investor) public {
|
||||
require(state == State.Refunding);
|
||||
uint256 depositedValue = deposited[investor];
|
||||
deposited[investor] = 0;
|
||||
|
||||
@@ -19,7 +19,7 @@ contract Destructible is Ownable {
|
||||
selfdestruct(owner);
|
||||
}
|
||||
|
||||
function destroyAndSend(address _recipient) public onlyOwner {
|
||||
function destroyAndSend(address payable _recipient) public onlyOwner {
|
||||
selfdestruct(_recipient);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import './Ownable.sol';
|
||||
* This allows the new owner to accept the transfer.
|
||||
*/
|
||||
contract Claimable is Ownable {
|
||||
address public pendingOwner;
|
||||
address payable public pendingOwner;
|
||||
|
||||
/**
|
||||
* @dev Modifier throws if called by any account other than the pendingOwner.
|
||||
@@ -26,7 +26,7 @@ contract Claimable is Ownable {
|
||||
* @dev Allows the current owner to set the pendingOwner address.
|
||||
* @param newOwner The address to transfer ownership to.
|
||||
*/
|
||||
function transferOwnership(address newOwner) public onlyOwner {
|
||||
function transferOwnership(address payable newOwner) public onlyOwner {
|
||||
pendingOwner = newOwner;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ pragma solidity ^0.4.11;
|
||||
* functions, this simplifies the implementation of "user permissions".
|
||||
*/
|
||||
contract Ownable {
|
||||
address public owner;
|
||||
address payable public owner;
|
||||
|
||||
|
||||
/**
|
||||
@@ -34,7 +34,7 @@ contract Ownable {
|
||||
* @dev Allows the current owner to transfer control of the contract to a newOwner.
|
||||
* @param newOwner The address to transfer ownership to.
|
||||
*/
|
||||
function transferOwnership(address newOwner) public onlyOwner {
|
||||
function transferOwnership(address payable newOwner) public onlyOwner {
|
||||
if (newOwner != address(0)) {
|
||||
owner = newOwner;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ contract PullPayment {
|
||||
* @dev withdraw accumulated balance, called by payee.
|
||||
*/
|
||||
function withdrawPayments() public {
|
||||
address payee = msg.sender;
|
||||
address payable payee = msg.sender;
|
||||
uint256 payment = payments[payee];
|
||||
|
||||
if (payment == 0) {
|
||||
|
||||
Reference in New Issue
Block a user