diff --git a/app_config.js b/app_config.js index 58a0e93..6e843fc 100644 --- a/app_config.js +++ b/app_config.js @@ -20,7 +20,7 @@ module.exports = { }, rinkeby: { contract_addresses:{ - 'Conference': '0xDdDf97B54a515172AadD9590d5aBCE524683f390', + 'Conference': null, 'ConfirmationRepository': null }, name: 'RINKEBY NET', diff --git a/contracts/Conference.sol b/contracts/Conference.sol index 0e34f66..69502c7 100644 --- a/contracts/Conference.sol +++ b/contracts/Conference.sol @@ -90,12 +90,12 @@ contract Conference is Destructible { } } - function registerWithEncryption(string _participant, string _encrypted) public payable onlyActive{ + function registerWithEncryption(string _participant, string _encrypted) external payable onlyActive{ registerInternal(_participant); RegisterEvent(msg.sender, _participant, _encrypted); } - function register(string _participant) public payable onlyActive{ + function register(string _participant) external payable onlyActive{ registerInternal(_participant); RegisterEvent(msg.sender, _participant, ''); } @@ -110,7 +110,7 @@ contract Conference is Destructible { participants[msg.sender] = Participant(_participant, msg.sender, false, false); } - function attendWithConfirmation(bytes32 _confirmation) public onlyActive{ + function attendWithConfirmation(bytes32 _confirmation) external onlyActive{ require(isRegistered(msg.sender)); require(!isAttended(msg.sender)); require(confirmationRepository.claim(_confirmation, msg.sender)); @@ -120,7 +120,7 @@ contract Conference is Destructible { AttendEvent(msg.sender); } - function withdraw() public onlyEnded{ + function withdraw() external onlyEnded{ require(payoutAmount > 0); Participant participant = participants[msg.sender]; require(participant.addr == msg.sender); @@ -128,7 +128,7 @@ contract Conference is Destructible { require(participant.paid == false); participant.paid = true; - assert(participant.addr.send(payoutAmount)); + participant.addr.transfer(payoutAmount); WithdrawEvent(msg.sender, payoutAmount); } @@ -137,7 +137,7 @@ contract Conference is Destructible { return this.balance; } - function confirmation() constant public returns (bool){ + function confirmation() constant external returns (bool){ return address(confirmationRepository) != address(0); } @@ -160,14 +160,14 @@ contract Conference is Destructible { /* Admin only functions */ - function payback() public onlyOwner onlyActive{ + function payback() external onlyOwner onlyActive{ payoutAmount = payout(); ended = true; endedAt = now; PaybackEvent(payoutAmount); } - function cancel() public onlyOwner onlyActive{ + function cancel() external onlyOwner onlyActive{ payoutAmount = deposit; cancelled = true; ended = true; @@ -176,19 +176,20 @@ contract Conference is Destructible { } /* return the remaining of balance if there are any unclaimed after cooling period */ - function clear() public onlyOwner onlyEnded{ + function clear() external onlyOwner onlyEnded{ require(now > endedAt + coolingPeriod); require(ended); var leftOver = totalBalance(); - require(owner.send(leftOver)); + + owner.transfer(leftOver); ClearEvent(owner, leftOver); } - function setLimitOfParticipants(uint _limitOfParticipants) public onlyOwner onlyActive{ + function setLimitOfParticipants(uint _limitOfParticipants) external onlyOwner onlyActive{ limitOfParticipants = _limitOfParticipants; } - function attend(address[] _addresses) public onlyOwner onlyActive{ + function attend(address[] _addresses) external onlyOwner onlyActive{ for(uint i=0;i<_addresses.length;i++){ var _addr = _addresses[i]; require(isRegistered(_addr)); diff --git a/truffle.js b/truffle.js index 06b130f..b5a3c81 100644 --- a/truffle.js +++ b/truffle.js @@ -40,6 +40,7 @@ module.exports = { host: "localhost", network_id: 4, port: 8545, + from: "0xbfb142f5bc1d33b7e173acd77719375faf5c72c1", // default address to use for any transaction Truffle makes during migrations gasPrice: 50000000000 // 50 gwei, }, ropsten: {