pragma solidity ^0.4.25; contract BuyerSeller1{ address public sellerAddress; address public buyerAddress; bytes32 enterpass; bytes32 sellerpass; bytes32 hexpass; bool public paid; bool public confirmed; bool public acknowledge; bool public delivered; bool public passwordMatched; uint pay_amount; modifier onlyBuyer(){ require(msg.sender == buyerAddress); _; } modifier onlySeller(){ require(msg.sender == sellerAddress); _; } constructor(bytes32 _hexpass, address _sellerAddress) public{ buyerAddress = msg.sender; sellerAddress = _sellerAddress; hexpass = _hexpass; } /* function stringToBytes32(string memory pass)public pure returns (bytes32 result) { bytes memory tempEmptyStringTest = bytes(pass); if (tempEmptyStringTest.length == 0) { return 0x0; } assembly { result := mload(add(pass, 32)) } }*/ function confirmPurchase() public returns(bool){ require (buyerAddress == msg.sender); confirmed = true; return confirmed; } function deliveredParcel(bytes32 _hexpass)onlyBuyer public returns(bool) { require(buyerAddress == msg.sender); require(confirmed == true); acknowledge = true; delivered = true; sellerpass = _hexpass; } function passwordMatching(bytes32 _enterpass) public returns (bool) { enterpass = _enterpass; if(sellerpass == enterpass){ return passwordMatched = true; }else{ return passwordMatched = false; } } function transferFrom(address _from, address _to, uint value) public payable returns(bool){ buyerAddress = _from; sellerAddress = _to; value = msg.value; paid = true; } }
0.4.25